/**
  * 
  * @param s string字符串 
  * @return string字符串
  */
 function Typing( s ) {
    //1.切割以>符号的数组
    let strings = s.split("");
    let res = [];//模拟栈
    for (let i = 0; i < strings.length; i++) {

        const element = strings[i];
        //2.退格删除数组字母
        if(element!="<"){
            res.push(element);
        }else{
            res.pop();
        }
    }
    return res.join("");
}

console.log(Typing("<aa<cb<"));
